import { stringify } from 'qs';
import request from '../utils/request';

/*利用json-server数据*/
export async function cardlist() {
  //查列表数据
  return request('http://localhost:3000/cards', {
    method: 'GET',
  });
}

export async function cardDetail(params) {
  //详情数据
  return request(`http://localhost:3000/cards/${params}`, {
    method: 'GET',
  });
}
export async function creatcard(params) {
  //增添数据
  return request('http://localhost:3000/cards', {
    method: 'POST',
    body: params,
  });
}
export async function removecard(params) {
  //删除数据
  return request('http://localhost:3000/cards/' + params, {
    method: 'DELETE',
  });
}